package com.jxufe.day04;

public class TestThread {
	
	public static void testThread1(){
		Thread ct = Thread.currentThread();
		System.out.println(ct);
		for(int i = 0; i<3;i++) {
			System.out.println(i);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	public static void main(String[] args) {
		new MyThread1().start();
		new MyThread2().start();
	}

}
class MyThread1 extends Thread{

	@Override
	public void run() {
		System.out.println("Thread1 start......");
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("Thread1 end......");
	}
	
}
class MyThread2 extends Thread{
	
	@Override
	public void run() {
		System.out.println("Thread2 start......");
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("Thread2 end......");
	}
	
}